﻿<Window x:Class="CPPEI.Coolzon.UI.XProperty.Editors.BrushEditWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:extToolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
        xmlns:local="clr-namespace:CPPEI.Coolzon.UI"
        xmlns:runtime="clr-namespace:CPPEI.Coolzon.Designtime"
        Title="颜色"
        WindowStartupLocation="CenterScreen" MinHeight="328" MinWidth="257" Height="328" Width="257"   Loaded="Window_Loaded"  
        Style="{DynamicResource WindowStyle}" >
    <Window.Resources>
        <ObjectDataProvider x:Key="dataTileMode" MethodName="GetValues" ObjectType="{x:Type TileMode}">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="TileMode" />
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
        <ObjectDataProvider x:Key="dataStretch" MethodName="GetValues" ObjectType="{x:Type Stretch}" >
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="Stretch" />
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <RadioButton GroupName="a" Name="_ctlBrushNull" Content="Null" Checked="_ctlBrushNull_Checked"/>
            <RadioButton GroupName="a" Name="_ctlBrushSolid" Content="Solid" Checked="_ctlBrushSolid_Checked"/>
            <RadioButton GroupName="a" Name="_ctlBrushGradient" Content="Gradient" Checked="_ctlBrushGradient_Checked"/>
            <RadioButton GroupName="a" Name="_ctlBrushImage" Content="Image" Checked="_ctlBrushImage_Checked"/>
        </StackPanel>
        <Border Grid.Row="1" BorderBrush="#EEEEF2" BorderThickness="2" Background="#F8F9FA">
            <StackPanel>
                <extToolkit:ColorCanvas x:Name="colorPlate" BorderThickness="0"/>
                <Grid x:Name="gdImage" Visibility="Collapsed">
                    <Grid.RowDefinitions>
                        <RowDefinition></RowDefinition>
                        <RowDefinition></RowDefinition>
                        <RowDefinition></RowDefinition>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="auto"></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="图片资源：" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Bottom"></TextBlock>
                    <StackPanel Orientation="Horizontal" Grid.Column="1" >
                        <ComboBox x:Name="cbPicName" SelectionChanged="cbPicName_SelectionChanged">
                            <ComboBox.ItemTemplate>
                                <HierarchicalDataTemplate DataType="{x:Type runtime:ImageRes}" >
                                    <TextBlock Text="{Binding Name}"/>
                                </HierarchicalDataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>
                        <!--<TextBox x:Name="tbfileName" Width="150"></TextBox>
                        <Button Content="浏览" x:Name="btnSelectImage" Click="btnSelectImage_Click" ></Button>-->
                    </StackPanel>

                    <TextBlock Text="TileMode：" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Bottom"></TextBlock>
                    <TextBlock Text="Stretch：" Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom"></TextBlock>

                    <ComboBox x:Name="cbTileMode" Grid.Column="1" Grid.Row="1" ItemsSource="{Binding Source={StaticResource dataTileMode}}" SelectionChanged="cbTileMode_SelectionChanged" ></ComboBox>
                    <ComboBox x:Name="cbStretch" Grid.Column="1" Grid.Row="2" ItemsSource="{Binding Source={StaticResource dataStretch}}"  SelectionChanged="cbStretch_SelectionChanged" ></ComboBox>
                    <Canvas Grid.ColumnSpan="2" x:Name="imagePreview" Grid.Row="3" Width="100" Height="100" HorizontalAlignment="Center" VerticalAlignment="Center">
                    </Canvas>
                </Grid>
                <local:ColorSlider x:Name="colorSlider" Visibility="Collapsed" />
            </StackPanel>
        </Border>
        <StackPanel Grid.Row="2">
            <Button Style="{DynamicResource  SubmitOrCancelButtonStyle}"  Content="提 交" Name="_ctlBtnOK" Click="_ctlBtnOK_Click_1"/>
        </StackPanel>
    </Grid>
</Window>
